package com.shj.util;

import java.util.Random;

/**
 * @author songhuajian
 * @Description: TODO
 * @date 2020/6/16 22:54
 **/
public class MyIdUtil {

    /**
     * @Description 生成时间+随机五位数的编号
     * @author songhuajian
     * @date 2020/6/16 22:57
     */
    public static String getTimeId() {
        String time = MyTimeUtil.getForString();
        String id = getId();
        return time + id;
    }

    /**
     * @Description 随机生成五位数字
     * @author songhuajian
     * @date 2020/6/16 22:57
     */
    public static String getId() {
        Random rnd = new Random();
        StringBuffer sb = new StringBuffer(3);
        for (int i = 0; i < 5; i++) {
            sb.append((char)('0' + rnd.nextInt(10)));
        }
        return sb.toString();
    }
}
